<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');?>

<div class="row">
	<div class="col-lg-10 mx-auto">
		<div class="card card-body">
			<form action="<?php echo url("plugin-setting-xn_ipaccess");?>" method="post" id="form">
				<h4 class="card-title">每日IP 限制设置</h4>
				<div class="form-group row">
					<label class="col-sm-3 form-control-label">每日注册用户数：</label>
					<div class="col-sm-9">
						<?php echo $input['users']; ?>
					</div>
				</div>
				<div class="form-group row">
					<label class="col-sm-3 form-control-label">每日登陆次数：</label>
					<div class="col-sm-9">
						<?php echo $input['logins']; ?>
					</div>
				</div>
				<div class="form-group row">
					<label class="col-sm-3 form-control-label">每日发送邮件数：</label>
					<div class="col-sm-9">
						<?php echo $input['mails']; ?>
					</div>
				</div>
				<div class="form-group row">
					<label class="col-sm-3 form-control-label">每日主题数：</label>
					<div class="col-sm-9">
						<?php echo $input['threads']; ?>
					</div>
				</div>
				<div class="form-group row">
					<label class="col-sm-3 form-control-label">每日回帖数：</label>
					<div class="col-sm-9">
						<?php echo $input['posts']; ?>
					</div>
				</div>
				<div class="form-group row">
					<label class="col-sm-3 form-control-label">每日附件个数：</label>
					<div class="col-sm-9">
						<?php echo $input['attachs']; ?>
					</div>
				</div>
				<div class="form-group row">
					<label class="col-sm-3 form-control-label">每日附件大小总数：</label>
					<div class="col-sm-9">
						<?php echo $input['attachsizes']; ?>
					</div>
				</div>
				<div class="form-group row">
					<label class="col-sm-3 form-control-label">连续发表主题上限：</label>
					<div class="col-sm-9">
						<?php echo $input['seriate_threads']; ?>
					</div>
				</div>
				<div class="form-group row">
					<label class="col-sm-3 form-control-label">连续回帖上限：</label>
					<div class="col-sm-9">
						<?php echo $input['seriate_posts']; ?>
					</div>
				</div>
				<div class="form-group row">
					<label class="col-sm-3 form-control-label">连续注册用户数上限：</label>
					<div class="col-sm-9">
						<?php echo $input['seriate_users']; ?>
					</div>
				</div>
				<div class="form-group row">
					<label class="col-sm-3 form-control-label"></label>
					<div class="col-sm-9">
						<button type="submit" class="btn btn-primary btn-block" id="submit" data-loading-text="<?php echo lang('submiting');?>..."><?php echo lang('confirm');?></button>
						<a role="button" class="btn btn-secondary btn-block mt-3" href="javascript:history.back();"><?php echo lang('back');?></a>
					</div>
				</div>
			</form>
			<p class="text-small text-muted">注： 0 表示不限制</p>
		</div>
	</div>
</div>

<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>

<script>

var jform = $("#form");
var jsubmit = $("#submit");
var referer = '<?php echo http_referer();?>';
jform.on('submit', function(){
	jform.reset();
	jsubmit.button('loading');
	var postdata = jform.serialize();
	$.xpost(jform.attr('action'), postdata, function(code, message) {
		if(code == 0) {
			$.alert(message);
			jsubmit.text(message).delay(2000).button('reset').location(referer);
			return;
		} else {
			$.alert(message);
			jsubmit.button('reset');
		}
	});
	return false;
});

</script>